<template>
  <section
    class="SelectorItem__container"
    :class="item.selected ? 'border' : ''"
    @click="item.selected = !item.selected"
  >
    <div class="icon">
      <!-- <i
        class="iconfont icon-gou"
        :class="item.selected ? 'selected' : 'no-selected'"
        >已选</i
      > -->
      <span class="text" :class="item.selected ? 'selected' : 'no-selected'"
        >已选择</span
      >
    </div>
    <slot />
  </section>
</template>

<script>
export default {
  props: {
    multi: {
      type: Boolean,
      default: true,
    },

    item: {
      type: Object,
      default: () => {
        return { selected: false };
      },
    },
  },
};
</script>

<style lang="scss" scoped>
.SelectorItem__container {
  box-sizing: border-box;
  border: 2px solid transparent;
  position: relative;

  .text {
    border-radius: 50%;
    border: 3px solid #67c23a;
    width: 80px;
    height: 80px;
    position: absolute;
    top: 45%;
    right: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #67c23a;
    font-weight: bold;
    transform: rotate(-30deg);
    opacity: 0.2;
    font-size: 2rem;
  }

  .icon {
    i {
      transition: 1s;
    }

    .selected {
      display: flex;
      // color: #67c23a;
      // font-weight: bold;
      // font-size: 5rem;
      // opacity: 0.5;
    }

    .no-selected {
      display: none;
    }
  }
}
</style>